package org.jpass.dc.business.admin.bean;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.jpass.dc.common.bean.UUIDSupport;

@Entity
@Table(name = "t_admin")
@SuppressWarnings("serial")
public class AdminBean extends UUIDSupport implements Serializable {

	private String name; // 用户昵称
	private String realName; // 真实姓名
	private String password; // 登录密码
	private String sex;
	private Date birthday;
	private Integer authority; // 权限
	private String authorityName; // 权限等级名称
	private String creater; // 创建人
	private Date createdTime; // 注册时间
	private Integer isOnline; // 是否在线
	private Integer loginTimes; // 最后登录时间
	private Date lastSignTime; // 最后登录时间
	private Date thisSignTime; //本次登录时间
	private String notes; // 备注
	
	public AdminBean() {
	}

	public AdminBean(String id, String name, String realName, String sex, Date birthday, String password, Integer authority,
			String authorityName, Date createdTime, String creater, Integer isOnline, Date lastSignTime, Date thisSignTime, String notes) {
		this.id = id;
		this.name = name;
		this.realName = realName;
		this.sex = sex;
		this.birthday = birthday;
		this.password = password;
		this.authority = authority;
		this.authorityName = authorityName;
		this.createdTime = createdTime;
		this.creater = creater;
		this.isOnline = isOnline;
		this.lastSignTime = lastSignTime;
		this.thisSignTime = thisSignTime;
		this.notes = notes;
	}

	@Column(name = "name", nullable = false)
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "sex", nullable = true)
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "birthday", nullable = true)
	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name = "realName", nullable = false)
	public String getRealName() {
		return realName;
	}
	
	public void setRealName(String realName) {
		this.realName = realName;
	}
	
	@Column(name = "password", nullable = false)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "authority", nullable = false)
	public Integer getAuthority() {
		return authority;
	}

	public void setAuthority(Integer authority) {
		this.authority = authority;
	}

	@Column(name = "authorityName", nullable = true)
	public String getAuthorityName() {
		return authorityName;
	}

	public void setAuthorityName(String authorityName) {
		this.authorityName = authorityName;
	}

	@Column(name = "creater", nullable = false)
	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	@Column(name = "createdTime", nullable = true)
	public Date getCreatedTime() {
		return createdTime;
	}

	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}

	@Column(name = "isOnline", nullable = true)
	public Integer getIsOnline() {
		return isOnline;
	}

	public void setIsOnline(Integer isOnline) {
		this.isOnline = isOnline;
	}

	@Column(name = "loginTimes", nullable = true)
	public Integer getLoginTimes() {
		return loginTimes;
	}

	public void setLoginTimes(Integer loginTimes) {
		this.loginTimes = loginTimes;
	}

	@Column(name = "lastSignTime", nullable = true)
	public Date getLastSignTime() {
		return lastSignTime;
	}

	public void setLastSignTime(Date lastSignTime) {
		this.lastSignTime = lastSignTime;
	}

	@Column(name = "thisSignTime", nullable = true)
	public Date getThisSignTime() {
		return thisSignTime;
	}

	public void setThisSignTime(Date thisSignTime) {
		this.thisSignTime = thisSignTime;
	}

	@Column(name = "notes", nullable = true )
	public String getNotes() {
		return notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AdminBean other = (AdminBean) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
}
